package com.example.servicemodule

import android.app.Service
import android.content.Intent
import android.os.IBinder
import android.util.Log

/**
 * 远程Service
 */
class MyRemoteService:Service() {
    private  val TAG = "MyRemoteService"
    override fun onBind(intent: Intent?): IBinder? {
//        TODO("Not yet implemented")
        Log.e(TAG, "onBind: ")
        return  StudentService()
    }

    override fun onUnbind(intent: Intent?): Boolean {
        Log.e(TAG, "onUnbind: " )
        return super.onUnbind(intent)
    }

    //处理student相关的业务逻辑类
//    private class Student:
    private class StudentService:IMyAidlInterface.Stub(){
        private val TAG = "MyRemoteService"
        override fun basicTypes(anInt: Int, aLong: Long, aBoolean: Boolean, aFloat: Float, aDouble: Double, aString: String?) {
//            TODO("Not yet implemented")

        }

        override fun getStudentById(id: Int): com.example.servicemodule.Student {
//            TODO("Not yet implemented")
            Log.e(TAG, "Service getStudentById:$id", )
            return Student(id,"Tom", 10000.toDouble())
        }

    }
}
